<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.Chart.UI.PieChartResources"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
  xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
  xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals">
    <ResourceDictionary.MergedDictionaries>
        <chartui:PieSeriesResources/>
    </ResourceDictionary.MergedDictionaries>
  <DataTemplate DataType="{x:Type chart:PieChart}">
    <Grid Name="outerGrid" chartui:ChartElement.Chart="{Binding}"
          
          >
            <ContentPresenter Content="{Binding RelativeSource={RelativeSource Self}, Path=(chartui:ChartElement.PlotArea)}"
                          ContentTemplate="{x:Static chartui:PlotAreaResources.PlotAreaBackgroundTemplate}"
                          Grid.Row="1" Grid.Column="1"/>
            <ContentPresenter Content="{Binding Series[0]}" RenderTransformOrigin="0.5 0.5" Name="cp">
                <ContentPresenter.RenderTransform>
                    <RotateTransform >
                        <RotateTransform.Angle>
                            <Binding  ElementName="outerGrid" Path="(chartui:ChartElement.Chart).FirstSliceAngle" Mode="OneWay" Converter="{x:Static Internals:ChartConverters.InvertConverter}">
                            </Binding>
                        </RotateTransform.Angle>
                    </RotateTransform>
                </ContentPresenter.RenderTransform>
            </ContentPresenter>
           

    </Grid>
  </DataTemplate>

</ResourceDictionary>